package com.ruoyi.mapper;


import com.ruoyi.domain.Category;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 【请填写功能名称】Mapper接口
 *
 * @author ruoyi
 * @date 2023-12-27
 *
 */
@Mapper
public interface CategoryMapper
{
//    @Insert("INSERT INTO sys_category (name, create_time, value) " +
//            "VALUES (#{name},  #{createTime}, #{value})")
//    int addCategory (Category category);
//    @Delete("UPDATE  sys_category SET is_delete = 1 WHERE category_id =#{id}")
//    int deleteCategory (Long id);
//
//    @Select("SELECT * FROM sys_category WHERE is_delete=0")
//    List<Category> selectCategory();
//
//    @Select("select name , value from sys_category")
//    List<Category> selectCategoryDict();
//
//    @Select("select name from sys_category where value=#{value}")
//    String name(int value);
@Insert("INSERT INTO sys_category (name, create_time, value) " +
        "VALUES (#{name},  #{createTime}, #{value})")
int addCategory (Category category);

    @Delete("UPDATE  sys_category SET is_delete = 1 WHERE category_id =#{id}")
    int deleteCategory (Long id);

    @Select("SELECT * FROM sys_category WHERE is_delete=0")
    List<Category> selectCategory();

    @Select("select name , value from sys_category")
    List<Category> selectCategoryDict();

    @Select("select name from sys_category where value=#{value}")
    String name(int value);


}
